from flask_sqlalchemy import SQLAlchemy

db = SQLAlchemy()

class users(db.Model):
    uuid = db.Column(db.Text, primary_key=True, unique=True)
    username = db.Column(db.Text,  nullable=False)
    password = db.Column(db.Text, nullable=False)
    nickname = db.Column(db.Text, nullable=True)
    # 权限((0, '超级管理员'),(1, '管理员'), (2, '普通用户'))
    role = db.Column(db.Integer, nullable=False, default=2)
    mobile = db.Column(db.Text, nullable=True)
    email = db.Column(db.Text, nullable=True)
    # 是否允许登录((0, '封号'), (1, '正常'))
    status = db.Column(db.Integer, nullable=False, default=1)
    create_time = db.Column(db.DateTime, nullable=False)
    gender = db.Column(db.Integer, nullable=True, default=1)

